Understanding the differences between JavaScript's variable declaration keywords `var`, `let`, and `const` is crucial for effective code writing. `Var` is function-scoped, while `let` and `const` are block-scoped, with `const` being non-reassignable. Best practices include using `var` sparingly, `let` for reassignable variables, and `const` for constants or to prevent accidental reassignment.
Lexical scoping helps JavaScript find variables by defining accessibility scope using a combination of global, function, and block scopes, and closures to search for variables in local, outer, and global scopes.
